Skip to content

perf(spanner-jdbc): cache positional to named param conversion - #14034

Merged
rahul2393 merged 1 commit into
mainfrom
cache-positional-parameter-conversion
Aug 18, 2026
Merged

perf(spanner-jdbc): cache positional to named param conversion#14034
rahul2393 merged 1 commit into
mainfrom
cache-positional-parameter-conversion

Conversation

@olavloite

Copy link
Copy Markdown
Contributor

Cache the result of converting a JDBC SQL string containing positional parameters (?), so we do not need to do this conversion over and over each time a SQL string is executed.

@olavloite
olavloite requested review from a team as code owners August 11, 2026 12:58

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a cache for positional parameters (positionalParametersCache) in AbstractStatementParser to avoid repeatedly scanning and translating statements that use positional parameters, along with corresponding unit tests. The review feedback suggests optimizing the memory footprint of the new cache by allocating a smaller fraction of maxCacheSize to it, and improving code readability by using explicitly typed lambda parameters instead of an explicit cast in the cache builder.

Cache the result of converting a JDBC SQL string containing positional parameters (?),
so we do not need to do this conversion over and over each time a SQL string is executed.
@olavloite
olavloite force-pushed the cache-positional-parameter-conversion branch from de9aefa to 9c5ceef Compare August 11, 2026 13:06
@rahul2393
rahul2393 merged commit 30e031b into main Aug 18, 2026
205 checks passed
@rahul2393
rahul2393 deleted the cache-positional-parameter-conversion branch August 18, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants